<template>
    <div ref="body">
        <Form :label-width="120" inline>
            <Form-item label="属地区划:">
                <area-linkage :areaCode.sync="queryParam.azaa0001"></area-linkage>
            </Form-item>
            <Form-item label="人员姓名:">
                <Input v-model="queryParam.azcp0003" placeholder="请输入户主姓名" style="width:200px"/>
            </Form-item>
            <Form-item label="户主身份证号码:">
                <Input v-model="queryParam.azcp0001" placeholder="请输入户主身份证号码" style="width:200px"/>
            </Form-item>
            <Form-item label="家庭编号:">
                <Input v-model="queryParam.azdf0001" placeholder="请输入家庭编号" style="width:200px"/>
            </Form-item>
            <Form-item label="低保证号:">
                <Input v-model="queryParam.ssca0014" placeholder="请输入低保证号" style="width:200px"/>
            </Form-item>
            <Form-item label="受理编号:">
                <Input v-model="queryParam.ssca0061" placeholder="请输入受理编号" style="width:200px"/>
            </Form-item>
            <Form-item label="申请救助类型:">
                <c-dict-select v-model="queryParam.ssca0002" dictCode="assistancetype" showKeys="100,101,102"
                               placeholder="请选择申请救助类型" v-if="type=='100'"/>
                <c-dict-select v-model="queryParam.ssca0002" dictCode="assistancetype" showKeys="200,201,202,203"
                               placeholder="请选择申请救助类型" v-if="type=='200'"/>
            </Form-item>
            <Row class="button_row">
                  <span style="float: right;">
                 <Button type="primary" @click="searchQuery">查询</Button>
                 <Button type="primary" class="button_item_left" @click="searchResetNew">重置</Button>
                     </span>
            </Row>
        </Form>
        <div class="table_div">
            <vxe-table border
                       resizable
                       row-id="id"
                       :row-key="true"
                       show-overflow="tooltip"
                       highlight-hover-row
                       align="center"
                       header-align="center"
                       ref="xTree"
                       :loading="Loading"
                       :data="tableData">
                <vxe-table-column field="ssca0043" title="属地区划" align="center" width="220" :formatter="renderAreaName"/>
                <vxe-table-column field="azcp0003" title="申请人" align="center" width="100"/>
                <vxe-table-column field="azcp0001" title="身份证号码" align="center" width="200"/>
                <vxe-table-column field="azdf0001" title="家庭编号" align="center" width="200"/>
                <vxe-table-column field="ssca0002" title="申请救助类型" align="center" width="200"/>
                <vxe-table-column field="ssca0096" title="审批救助类型" align="center" width="200"/>
                <vxe-table-column field="ssca0016" title="业务类型" align="center" width="200"/>
                <vxe-table-column field="ssca0003" title="受理时间" align="center" width="200" :formatter="renderTime"/>
                <vxe-table-column field="ssca0061" title="受理编号" align="center" width="200"/>
                <vxe-table-column field="ssca0014" title="低保证号" align="center" width="200"/>

                <vxe-table-column title="操作" align="center" width="140" fixed="right">
                    <template #default="{row}">
                        <Button type="default" @click="detail(row)">查看详情</Button>
                    </template>
                </vxe-table-column>
            </vxe-table>
            <Page :total="dataCount" :page-size="pageSize" show-total class="paging"
                  @on-change="handleTableChange" :current="pageNo"></Page>
        </div>
        <history-drawer ref="modalForm"/>
    </div>
</template>

<script>
    import {CommonMixin} from '@/views/common/js/CommonMixin'
    import historyDrawer from './modules/historyDrawer'

    export default {
        name: "history",
        mixins: [CommonMixin],
        components: {historyDrawer},
        data() {
            return {
                queryParam: {},
                ssca0002Type: "100,101",
                type: "",
                Loading: true,
                url: {
                    list: "/api/ac/subsistence/ss12001HistoryService/page",
                },
            }
        },
        methods: {
            edit(ssca0002Type, type) {
                this.ssca0002Type = ssca0002Type;
                this.queryParam.ssca0002Type = ssca0002Type;
                this.type = type;
                this.findAreaList();
            },
            searchResetNew() {
                this.queryParam = {};
                this.queryParam.ssca0002Type = this.ssca0002Type;
                this.loadData(1);
            },
            detail: function (row) {
                var width = this.$refs.body.clientWidth;
                this.$refs.modalForm.edit(row, width, this.ssca0002Type);
                this.$refs.modalForm.key = this.uuid();
            },
        },
    }
</script>

<style scoped>

</style>